<html xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.org/ui" >
    

    <ui:composition template="layout.xhtml">
        <ui:define name="body">
            <h2>Perguntas e Respostas</h2>
            <p:panel style=" background: none; border: none;">
                <h:form id="form" acceptcharset="utf-8">
                    <p:growl id="msg" life="5000"/>
                    <fieldset style="border: 1px solid #E3E3E3; ">
                        <ui:repeat value="#{managerAnalyzeQuestionnaire.categories}" var="c">
                            <p:panel header="#{c.name} " style="border: 0px; width:100%"/>         
                            <ul> 
                                <ol style="padding-left: 30px; color: #000000;">
                                    <ui:repeat value="#{c.issueses}" var="i">
                                        <li>
                                            <h:outputText value="#{i.title}" style="color: #000000; font-weight: bold"/>
                                            
                                        </li>
                                        <table style="width: 100%">
                                            <tr>
                                                <td style="width: 50%; vertical-align:top;">
                                                    <p:inputTextarea rendered="#{i.typeIssues eq 'OPEN'}" cols="60" />

                                                    <ol type="a" style="padding-left: 20px; vertical-align: top">

                                                        <ui:repeat value="#{i.options}" var="o">
                                                            <li style="margin: 0"> 
                                                                <p:selectOneRadio 
                                                                                   converter="optionsConverter" layout="pageDirection" 
                                                                                   rendered="#{i.typeIssues eq 'CHOOSEONE'}">  
                                                                    <f:selectItem  itemValue="#{o}"  
                                                                                   itemLabel="#{o.title}"

                                                                                   /> 
                                                                </p:selectOneRadio>


                                                                <p:selectManyCheckbox 
                                                                                      converter="optionsConverter" layout="pageDirection" 
                                                                                      rendered="#{i.typeIssues eq 'CHOICEMULTIPLE'}">  
                                                                    <f:selectItem  itemLabel="#{o.title}"
                                                                                   itemValue="#{o}"  
                                                                                   /> 
                                                                </p:selectManyCheckbox>


                                                            </li>
                                                        </ui:repeat>

                                                    </ol>
                                                </td>

                                                <td>    
                                                    


<!--                                        <p:barChart id="basic" value="{managerAnalyzeQuestionnaire.createGraphic(i)}" legendPosition="ne"  
                                            title="Gráfico"
                                            rendered="{i.typeIssues eq 'CHOICEMULTIPLE'}"
                                            min="0" max="5" style="width:400px" animate="true"/> -->

                                                    <p:pieChart value="#{managerAnalyzeQuestionnaire.createPieModel(i)}"
                                                                rendered="#{i.typeIssues eq 'CHOOSEONE'}"
                                                                showDataLabels="true"
                                                                legendPosition="w" title="Gráfico" style="width:400px;height:300px" />
                                                </td>
                                            </tr>
                                        </table>
                                    </ui:repeat>
                                </ol>
                            </ul>
                        </ui:repeat>
                    </fieldset>
                </h:form>
            </p:panel>
        </ui:define>
    </ui:composition>
</html>





